
#trellis.device(device="postscript", color = TRUE)
#postscript("consumo.eps", width = 10, height = 6, paper = "special", horizontal = FALSE, onefile = FALSE, colormodel = "rgb")

file <- commandArgs(TRUE)[1]

library(lattice)

r <- read.table(file)
colnames(r) <- c("Acertos","Erros", "V3", "V4", "V5","V6","V7","V8","V9","V10","LR","Momentum","HL","Iteracoes")

f1 <- r[r$HL <= 16,]

png("all.png", width=576, height=480)
xyplot(Acertos ~ LR |  sapply(f1$HL, paste, "Hidden Units"), groups=Iteracoes, data=f1, aspect=0.8, scale = list(x = list(log = TRUE, at = c(0.001, 0.003, 0.01, 0.03, 0.1, 0.3), cex=1), y = list(cex=1)), par.settings = list( superpose.symbol = list( cex=1.6, pch=c(0,1,2))), auto.key= list(corner=c(0.9,0.1), text = c("    100 iterações", "  1000 iterações", "10000 iterações"), cex=1.2), pch=c(0,1,2), type=c("b","g"), xlab=list("Learning Rate", cex=1.4), ylab=list("Acertos", cex=1.4))
dev.off();


f2 <- r[r$Iteracoes == 100 & r$LR == 0.03,]
png("hidden_units.png", width = 576, height=345)
xyplot(Acertos ~ HL, data=f2[order(f2$HL),], type=c("b"), scale = list(x=list(cex=1.2, at=seq(0,200,20)),y=list(cex=1.2)), aspect=0.6, xlab=list("Hidden Units", cex=1.4), ylab=list("Acertos", cex=1.4), cex=1.6)
dev.off();
